/**
 * Created by L.jp
 * Description:
 * User: 86189
 * Date: 2023-07-12
 * Time: 20:39
 */
public class Solution {
    public static double calAngle(int hour,int minute){
        //每小时时针走动的度数
        double degreesPerHour=30.0;
        //每分钟走动的度数
        double degreesPerMinute=6.0;
        //将小时调整12小时制
        hour=hour%12;
        //计算时针走动的度数
        double hourAngle=(hour*degreesPerHour)+(minute*degreesPerMinute/12);
        //计算分针走动的度数
        double minuteAngle=minute*degreesPerMinute;
        //计算夹角，绝对值
        double angle=Math.abs(hourAngle-minuteAngle);
        //最小夹角
        if(angle>180){
            angle=360-angle;
        }
        return angle;
        
        
    }
    public static void main(String[] args) {
        int hour=3;
        int minute=50;
        double angle=calAngle(hour,minute);
        System.out.println("夹角："+angle+"度");
    }
}
